<template>
		<view class="content">
			<image src="/static/index_bg.png" mode="" class="bg"></image>
			<view class="card">
				<view class="class_1">
					<view class="class-item" v-for="item in class1" @click="navPtah(item)">
						<image :src="item.img" mode=""></image>
						<view class="">
							{{item.name}}
						</view>
					</view>
				</view>
				<view class="class_2">
					<view class="class-item" v-for="item in class2" @click="navPtah(item)">
						<image :src="item.img" mode=""></image>
						<view class="">
							{{item.name}}
						</view>
					</view>
				</view>
			</view>
			<messageList :list="massagrsList" />
			<view class="authentication-btn">
				去APP实名认证
			</view>
			<Loading/>
		</view>
</template>
<script>
	export default {
		data() {
			return {
				class1: [{
					name: '收据',
					img: '/static/index_class/class_1.png',
					path:'receiptsList'
				}, {
					name: '支付记录',
					img: '/static/index_class/class_2.png',
					path:'paymentHistory'
				}, {
					name: '缴费记录',
					img: '/static/index_class/class_3.png',
					path:'paymentRecord'
				}, {
					name: '结息记录',
					img: '/static/index_class/class_3.png',
					path:'interestRecord'
				}],
				class2: [{
					name: '维修记录',
					img: '/static/index_class/class_5.png',
					path:'projects'
				}, {
					name: '分摊记录',
					img: '/static/index_class/class_6.png',
					path:'apportionRecords'
				}, {
					name: '投票记录',
					img: '/static/index_class/class_7.png',
					path:'pollResult'
				}, {
					name: '清算记录',
					img: '/static/index_class/class_8.png',
					path:'liquidationRecords'
				}], 
				massagrsList: []
			}
		},
		onLoad() {
			this.$myRequest('/api/messages').then(res=>{
				res.data.forEach(item=>{
					item.content=JSON.parse(item.content)
				})	
				this.massagrsList=res.data	
			})		
		},
		methods: {
			navPtah(item){
				uni.navigateTo({
					url:`/pages/index/${item.path}/${item.path}`
				})
			}
		}
	}
</script>

<style lang="scss">
	.content {
		background-color: #F5F5F5;
		min-height: 100vh;
		padding: 0 20rpx;

		.bg {
			position: absolute;
			top: 0;
			left: 0;
			width: 100vw;
			height: 578rpx;
		}
		.authentication-btn{
			width: 310rpx;
			height: 74rpx;
			line-height: 74rpx;
			color: #ffffff;
			background-color: #456FFD;
			border-radius: 37rpx;
			text-align: center;
			position: fixed;
			bottom: 48rpx;
			left: 50%;
			z-index: 9;
			transform: translateX(-50%);
			font-size: 28rpx;
		}

		.card {
			padding: 32rpx 40rpx;
			position: relative;
			top: 210rpx;

			.class_1,
			.class_2 {
				display: flex;
				justify-content: space-between;
				margin-top: 22rpx;

				.class-item {
					display: flex;
					flex-direction: column;
					justify-content: center;
					align-items: center;

					font-size: 28rpx;
					color: #333333;
					font-weight: 700;

					image {
						width: 110rpx;
						height: 110rpx;
						margin-bottom: 10rpx;
					}
				}
			}


		}


	}
</style>
